package com.laoluo.erp.dbtools;

/**
 * @author Ricky
 *
 */
public class Field {

	public String name = null;
	public String type = null;
	public boolean primaryKey = false;
	public boolean autoIncrease = false;
	public String javaType = null;
	
	/**
	 * 
	 */
	public Field(String name,String type,boolean primaryKey) {
		this.name = name;
		this.type = type;
		this.primaryKey = primaryKey;		
	}
	
	public Field()
	{}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isPrimaryKey() {
		return primaryKey;
	}
	public void setPrimaryKey(boolean primaryKey) {
		this.primaryKey = primaryKey;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {			
		this.type = type;
	}

	public boolean isAutoIncrease() {
		return autoIncrease;
	}

	public void setAutoIncrease(boolean autoIncrease) {
		this.autoIncrease = autoIncrease;
	}

	public String getJavaType() {
		return javaType;
	}

	public void setJavaType(String javaType) {
		int lastIndex = javaType.lastIndexOf(".");
		if(lastIndex >= 0){
			javaType = javaType.substring(lastIndex+1);
		}
		this.javaType = javaType;
	}

}
